<?php
/**
 * @version		$Id: default.php 20196 2011-01-09 02:40:25Z ian $
 * @package		Joomla.Site
 * @subpackage	mod_latest_product
 * @copyright	Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// no direct access
defined('_JEXEC') or die;
?>

<script type="text/javascript">

	jQuery().ready(function($){
		var latestDefaultSlider = $('#latest-default').bxSlider({
			auto: false,
			displaySlideQty: 3,
		    moveSlideQty: 3,
		    controls: false
		});

		$('#latest-default-prev').click(function(){
			latestDefaultSlider.goToPreviousSlide();
		    return false;
		});

		$('#latest-default-next').click(function(){
			latestDefaultSlider.goToNextSlide();
			return false;
		});
	});
</script>

<div id="latest-default-prev"></div>
<ul id="latest-default">
	<?php foreach ($list as $item): ?>
	<li>
		<?php 
		require_once JPATH_ROOT . DS . 'jelibs/classes/util.class.php';
		
		$file 		= JPATH_ROOT . DS . 'images/je_products/upload/' . $item->images;
		$thumbFile 	= JPATH_ROOT . DS . 'images/je_products/thumbs/thumb_' . $item->images;
		
		JEUtil::resizeImage($file, $thumbFile);
		?>
		
		<a title="<?php echo $item->location_name . ': ' . $item->name; ?>" href="<?php echo JRoute::_('index.php?option=com_je_product&view=detail&id='. $item->id); ?>">
			<img alt="Promotion Image" src="images/je_products/thumbs/thumb_<?php echo $item->images; ?>">
		</a>
		
		
	</li>
	<?php endforeach; ?>
</ul>
<div id="latest-default-next" class="last"></div>

<div class="clr"></div>